package cc.opcol.iot.server.sdk;

import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Component;

@Component
public class JSRepositoryAgent {
    ApplicationContext applicationContext;

    public Object get(String name){
        if(applicationContext==null){
            return null;
        }
        return applicationContext.getBean(name);
    }

    public ApplicationContext getApplicationContext() {
        return applicationContext;
    }

    public void setApplicationContext(ApplicationContext applicationContext) {
        this.applicationContext = applicationContext;
    }
}
